<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <link rel="stylesheet" href="__CSS__/index.css">
</head>

<body>
    <h1>后台管理系统</h1>
    <p>
        bs.js bs.css vue.js layui.css layui.js 图片.....
    </p>
    <p>
        "__IMAGE__/1.jpg";
    </p>
    <img src="__IMG__/1.jpg" alt="">
    <p>


        <a href="{:url('index/Index/login')}">后台</a>
    </p>
    <div id="logonVue">
        <h3>注册</h3>
        <p>账号<input type="text" class="useracc" v-model="userAcc"></p>
        <p>密码<input type="text" class="userapas" v-model="userPas"></p>
        <p><button @click="logon">登陆</button></p>
        <p></p>
    </div>
    <div>

    </div>
    <script>
        var LogonVue = new Vue({
            el: "#logonVue",
            data: {
                "userAcc": '',
                "userPas": '',
            },
            methods: {
                logon() {
                    var that = this;
                    $.ajax({
                        url: "{:url('index/index/logon')}",
                        data: {
                            'acc': that.userAcc,
                            'pas': that.userPas,
                        },
                        type: "POST",
                        dataType: "JSON",
                        success: (res) => {
                            if (res >= 1) {
                                alert('注册成功');

                            } else {
                                alert('注册失败');
                            };
                            that.userAcc = '';
                            that.userPas = '';
                        },
                        error: () => {
                            alert('系统错误');
                        }
                    })
                }
            },
        })
    </script>
</body>

</html>